<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<jsp:include page="base/header.jsp" flush="true"> 
 <jsp:param value="商品管理" name="pageTitle"/>
</jsp:include>

<!--必要样式-->
<link rel="stylesheet" href="<%=BusiConstant.context%>/common/css/style.css" type="text/css" />
<body>
<jsp:include page="base/nav.jsp" flush="true"></jsp:include>


<div id="content" style="margin-left:20px;font-size:12px;">
	<br>
 
	   <form id="chaxun">
	   	<div class="layui-form-item">
	   		<div class="layui-inline">
		   		<label class="layui-form-label">名称</label>
				<div class="layui-input-inline">
					<input type="text" name="realnameLike" class="layui-input" value="">
				</div>
			</div>
			
			<!-- <div class="layui-inline">
		    	<label class="layui-form-label">会员级别</label>
		    	<div class="layui-input-inline">
				    <select name="levelCode" style="width:100px;height:30px;">
				    	<option value="">无</option>
				        <option value="0000">非会员</option>
				        <option value="0001">一般会员</option>
				        <option value="0002">黄金会员</option>
				        <option value="0003">铂金会员</option>
				     </select>
			     </div>
		     </div> -->
	   
	        <input onclick="huodonglist(1)" class='self-btn' type="button" value="搜索">
	        
	     </div>
	     
	     
	     
	     
	     
	     
        </form>

  
   
    <div >
        <div>	
         	<table id="headtable">
         		<thead></thead>
             	<tbody></tbody>
            </table>
        </div>
        <div id="fanye"></div>
    </div>
</div>

</body>



<script>
	var table = createtable("headtable");
	
	var optfun = function(row){
		var tdinner = "";
		//"<button type='button' class='self-btn' onclick='lianghao("+row.id+")'>设置靓号</button>";; 
		return tdinner;
	}

	
	var imgtdfun = function(row){
		var tdinner = "<img style='width:200px;height:200px;' src='"+row.picurl+"'>";
		return tdinner;
	}
	
	
	table.th = [{w:100,na:"编号",colname:"id"}
	,{w:100,na:"昵称",colname:"nickname"}
	,{w:200,na:"电话",colname:"phone"}
	,{w:100,na:"姓名",colname:"realname"}
	,{w:100,na:"我的邀请码",colname:"code"}
	,{w:100,na:"成员数",colname:"chengyuan"}
	,{w:100,na:"余额",colname:"yue.yue"}
	,{w:100,na:"邀请人id",colname:"ref.id"}
	,{w:100,na:"邀请人昵称",colname:"ref.nickname"}
	,{w:200,na:"操作",callfun:optfun}];
	
	table.thinit();
	
	function sucdo(data){
		var rows = data.resultData.rows;
		fanye.init(data.resultData.total);	
		if(rows){	
			table.data = rows;
			table.tdinit();		
		}	
	}

	var fanye = new FanYe("fanye","huodonglist",0,20,1);
	
   function huodonglist(current){
	   if(!fanye.setpage(current)){
			return;
		}
	   var data = formtojson($('#chaxun'));
	   data.pageNo = fanye.current;
	   data.pageSize = fanye.limit;
	   var url = getbaseurl("/user/userlist.do");
	   postdo(url, data, sucdo,null, null);
   }
   huodonglist(1);
   
   function lianghao(id){	    
	   var str = window.prompt("设置靓号","");
	   if(str){
		   var data = {id:id,code:str};
		   var url = getbaseurl("/user/updateCode.do");
		   var s = function(redata){
			   var row = table.getrow(id);
			   row.disorder =parseInt(str);
			   table.tdinit();
		   }
		   postdo(url, data,s,null, null);
	   }	  
	}
  
     
</script>


</html>